home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacHack 2000
/
MacHack 2000.toast
/
pc
/
The Hacks
/
Softshoe
/
Lisa's Mac Parts
/
Views
/
ViewCell
/
CellCursorCollector.cp
< prev
next >
Wrap
Text File
|
2000-06-23
|
898b
|
40 lines
// CellCursorCollector.cp
#ifndef CellCursorCollector_h
#include "CellCursorCollector.h"
#endif
#ifndef ViewCell_h
#include "ViewCell.h"
#endif
#ifndef MouseEvent_h
#include "MouseEvent.h"
#endif
#ifndef Canvas_h
#include "Canvas.h"
#endif
CellCursorCollector::CellCursorCollector( const MouseEvent& theEvent,
RegionObject& theRegion )
: CellVisitor( Rectangle( theEvent.LocalPoint().h,
theEvent.LocalPoint().v,
theEvent.LocalPoint().h + 1,
theEvent.LocalPoint().v + 1 ) ),
event( theEvent ),
region( theRegion ),
cursor( 0 )
{
}
void CellCursorCollector::Visit( ViewCell& cell,
const Canvas& canvas )
{
Assert( cursor == 0 );
Assert( canvas.Visible() );
Assert( canvas.Clip().Contains( event.LocalPoint() ) );
region = canvas.Clip();
cursor = &cell.Cursor( canvas, event, region );
Assert( cursor != 0 );
}